<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path;
%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>
        ${title}
    </title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="stylesheet" href="<%=basePath%>/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="<%=basePath%>/css/font-awesome.min.css">
    <link rel="stylesheet" href="<%=basePath%>/css/ionicons.min.css">
    <link rel="stylesheet" href="<%=basePath%>/dist/css/AdminLTE.min.css">
    <link rel="stylesheet" href="<%=basePath%>/toastr/toastr.css" type="text/css"/>
    <link rel="stylesheet" href="<%=basePath%>/dist/css/skins/_all-skins.min.css">
    <link rel="stylesheet" href="<%=basePath%>/fileupload/fileinput.min.css"/>
    <link rel="stylesheet" href="<%=basePath%>/bootstrap-datetimepicker/css/bootstrap-datetimepicker.css">
    <link rel="stylesheet" href="<%=basePath%>/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css">
    <link rel="stylesheet" href="<%=basePath%>/plugins/iCheck/all.css">
    <link rel="stylesheet" href="<%=basePath%>/pagination/style/pagination.css" media="screen">
    <link rel="stylesheet" href="<%=basePath%>/plugins/iziModal/css/iziModal.min.css">
    <link rel="stylesheet" href="<%=basePath%>/plugins/select2/select2.min.css">
    <link rel="stylesheet" href="<%=basePath%>/plugins/iCheck/all.css">
    <link rel="stylesheet" href="<%=basePath%>/plugins/loaders/loaders.css"/>
    <link rel="stylesheet" href="<%=basePath%>/plugins/flavr/animate.css"/>
    <link rel="stylesheet" href="<%=basePath%>/plugins/flavr/flavr.css"/>
    <link rel="stylesheet" href="<%=basePath%>/plugins/bootstrap-treeview/css/bootstrap-treeview.css">
    <link rel="stylesheet" href="<%=basePath%>/plugins/viewer/viewer.min.css">
  <%--  <link rel="stylesheet" href="<%=basePath%>/plugins/autocompleter/jquery.autocompleter.css">
    <link rel="stylesheet" href="<%=basePath%>/plugins/autocompleter/main.css">
    <link rel="stylesheet" href="<%=basePath%>/plugins/autocompleter/normalize.css">
--%>
</head>
<!-- ADD THE CLASS sidedar-collapse TO HIDE THE SIDEBAR PRIOR TO LOADING THE SITE -->
    <body class="hold-transition skin-blue sidebar-mini">

    <!-- Site wrapper -->
    <div id="request-div" style="position: absolute;width: 100%;height: 100%;z-index: 5000;display: none;">
        <img src='<%=basePath%>/images/request-sending.gif' style="position: relative;top: 50%;left: 50%;width: 200px;height: 200px">
    </div>
    <div class="wrapper">
        <header class="main-header">
            <!-- Logo -->
            <jsp:include page="../logo.jsp" ></jsp:include >
            <!-- Header Navbar: style can be found in header.less -->
            <nav class="navbar navbar-fixed-top">
                <!-- Sidebar toggle button-->
                <a class="sidebar-toggle" data-toggle="offcanvas" role="button" onclick="show()">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </a>
                <jsp:include page="../menuTop.jsp"></jsp:include>
            </nav>

        </header>

        <!-- =============================================== -->

        <!-- Left side column. contains the sidebar -->
        <aside class="main-sidebar">
            <jsp:include page="../menu.jsp"></jsp:include>
            <!-- /.sidebar -->
        </aside>

        <input type="hidden" value="<%=basePath%>" id="basePath">
        <input type = "hidden" value="${loginUser.type}" id="userType">
        <!-- Content Wrapper. Contains page content -->
        <div class="content-wrapper" style="padding-top:50px;">
            <section class="content-header">
                <ol class="breadcrumb">
                    <li class="text-muted"><i class="fa fa-th"></i>&nbsp;&nbsp;服务管理:
                    </li>
                    <li class="text-muted"><i class="fa fa-circle-o"></i>&nbsp;&nbsp;保养
                    </li>
                </ol>
            </section>

            <input type="hidden" value="${loginUser.hospitalId}" id="hospitalId">
            <input type="hidden" id="realName" value="${loginUser.realName}">
            <input type="hidden" id="mobile" value="${loginUser.mobile}">
            <section class="content">
                <div class="row">
                    <div class="col-xs-12">
                        <div class="box box-info">
                            <div class="box-header with-border text-left">
                                <span class="">
                                    <button id="add" type="button"  class="btn btn-info btn-sm" data-toggle="tooltip" title="新增">
                                        <i class="fa fa-plus"></i>
                                    </button>
                                    <c:if test="${loginUser.type == '1104'}">
                                        <button id="assign" type="button" class="btn btn-info btn-sm" title="分配" data-original-title="分配">
                                        <i class="fa fa-hand-pointer-o"></i>
                                    </button>
                                    <button id="upkeepData" type="button" class="btn btn-info btn-sm" title="补全保养信息" data-original-title="补全保养信息">
                                        <i class="fa fa-edit"></i>
                                    </button>
                                      <button id="event" type="button" class="btn btn-info btn-sm" title="添加事件" data-original-title="添加事件">
                                        <i class="fa fa-warning"></i>
                                    </button>
                                     <button id="part" type="button" class="btn btn-info btn-sm" title="备件" data-original-title="备件">
                                        <i class="fa fa-navicon"></i>
                                    </button>
                                     <button id="update" type="button" class="btn btn-info btn-sm" title="修改负责人" data-original-title="修改负责人">
                                        <i class="fa fa-pencil"></i>
                                    </button>
                                    </c:if>
                                     <button id="comple" type="button" class="btn btn-info btn-sm" title="确认" data-original-title="确认">
                                        <i class="fa fa-check-square"></i>
                                    </button>
                                </span>

                                <span class="pull-right">
                                    <span>显示</span>
                                    <select id="show-count" style="color: #EA544A">
                                        <option value="20">20</option>
                                        <option value="50">50</option>
                                        <option value="100">100</option>
                                        <option value="200">200</option>
                                    </select>
                                    <span>条，</span>
                                    <span>共计</span>
                                    <span id="total-count">0</span>
                                    <span>条</span>
                                    <button id="search" type="button" class="btn btn-info btn-sm" data-toggle="tooltip" title="查询">
                                        <i class="fa fa-search"></i>
                                    </button>
                                </span>
                            </div>

                            <div class="box-body" style="margin: 5px 0px -10px 0px">
                                <!-- form start -->
                                <form id="queryForm" action="<%=basePath %>/upkeep/page" method="post">
                                    <div class="row">
                                        <div class="col-md-3">
                                            <div class="form-group">
                                                <input type="text" class="form-control" name="allName" value="" placeholder='设备名称/型号/序列号'>
                                            </div>
                                        </div>
                                        <c:if test="${loginUser.type == '1104'}">
                                            <div class="col-md-3">
                                                <div class="form-group">
                                                        <select style="width: 100%" name="hospitalId">
                                                        </select>
                                                </div>
                                            </div>
                                        </c:if>
                                        <div class="col-md-3">
                                            <div class="form-group">
                                                <select style="width: 100%" name="status">
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                </form>
                            </div>
                            <div class="box-body table-responsive no-padding">
                                <table class="table table-bordered table-hover">
                                    <thead>
                                        <tr class="info">
                                            <th class="text-center text-muted" style="width: 30px">#</th>
                                            <th class="text-center text-muted" style="width: 20px">&nbsp;</th>
                                            <th class="text-center text-muted" style="width: 20px">操作</th>
                                            <th class="text-muted">设备名称</th>
                                            <th class="text-muted">设备型号</th>
                                            <th class="text-muted">序列号</th>
                                            <th class="text-muted">申请人</th>
                                            <th class="text-muted">申请人电话</th>
                                            <th class="text-muted">医院</th>
                                            <th class="text-muted">服务商</th>
                                            <th class="text-muted">状态</th>
                                        </tr>
                                    </thead>
                                    <tbody id="upkeep_table"></tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
        </div>

        <!-- 自定义model模态框 《开始》-->

        <!-- 1.分配服务上的model -->
        <div id="assign-model" style="display: none;">
            <div class="box-body">
                <form id="assignForm" class="form-horizontal" method="post">
                    <input type="hidden" name="upkeepId" value="">
                    <input type="hidden" name="engineerId">
                    <input type="hidden" name="hospitalServiceType">
                    <input type="hidden" name="examine">
                    <table class="table table-striped table-bordered" border="0">
                        <tr>
                            <td class="text-muted " colspan="6">申请保养信息：</td>
                        </tr>

                        <tr>
                            <td class="text-muted " style="text-align: right">保养申请日期：</td>
                            <td class="text-muted " style="text-align: left"><span id="createTimeSpan"></span></td>
                            <td class="text-muted " style="text-align: right">保养申请人：</td>
                            <td class="text-muted " style="text-align: left"><span id="upkeepApplicantSpan"></span></td>
                            <td class="text-muted " style="text-align: right">申请人电话：</td>
                            <td class="text-muted " style="text-align: left"><span id="upkeepApplicantPhoneSpan"></span></td>
                        </tr>

                        <tr>
                            <td class="text-muted " colspan="6">设备信息：</td>
                        </tr>

                        <tr>
                            <td class="text-muted " style="text-align: right">医院名称：</td>
                            <td class="text-muted " style="text-align: left"><span id="hospitalNameSpan"></span></td>
                            <td class="text-muted " style="text-align: right">设备名称：</td>
                            <td class="text-muted " style="text-align: left"><span id="deviceNameSpan"></span></td>
                            <td class="text-muted " style="text-align: right">设备型号：</td>
                            <td class="text-muted " style="text-align: left"><span id="deviceModelSpan"></span></td>
                        </tr>

                        <tr>
                            <td class="text-muted " style="text-align: right">设备序列号：</td>
                            <td class="text-muted " style="text-align: left"><span id="snSpan"></span></td>
                            <td class="text-muted " style="text-align: right">启用日期：</td>
                            <td class="text-muted " style="text-align: left"><span id="enableTimeSpan"></span></td>
                            <td class="text-muted " style="text-align: right">上次保养时间：</td>
                            <td class="text-muted " style="text-align: left"><span id="lastUpkeepDateSpan"></span></td>
                        </tr>

                        <tr>
                            <td class="text-muted " style="text-align: right">厂商：</td>
                            <td class="text-muted " style="text-align: left"><span id="manufacturerNameSpan"></span></td>
                            <td class="text-muted " style="text-align: right">厂商联系人：</td>
                            <td class="text-muted " style="text-align: left"><span id="manufacturerContactsSpan"></span></td>
                            <td class="text-muted " style="text-align: right">厂商联系人电话：</td>
                            <td class="text-muted " style="text-align: left"><span id="manufacturerPhoneSpan"></span></td>
                        </tr>
                        <tr>
                            <td class="text-muted " style="text-align: right">经销商：</td>
                            <td class="text-muted " style="text-align: left"><span id="supplierNameSpan"></span></td>
                            <td class="text-muted " style="text-align: right">经销商联系人：</td>
                            <td class="text-muted " style="text-align: left"><span id="supplierContactsSpan"></span></td>
                            <td class="text-muted " style="text-align: right">经销商联系人电话：</td>
                            <td class="text-muted " style="text-align: left"><span id="supplierPhoneSpan"></span></td>
                        </tr>
                        <tr>
                            <td class="text-muted " style="text-align: right"> 维修商：</td>
                            <td class="text-muted " style="text-align: left"><span id="maintainerNameSpan"></span></td>
                            <td class="text-muted " style="text-align: right">维修商联系人：</td>
                            <td class="text-muted " style="text-align: left"><span id="maintainerContactsSpan"></span></td>
                            <td class="text-muted " style="text-align: right"> 维修商联系人电话：</td>
                            <td class="text-muted " style="text-align: left"><span id="maintainerPhoneSpan"></span></td>
                        </tr>
                        <tr>
                            <td class="text-muted " style="text-align: right">厂家保修有效期：</td>
                            <td class="text-muted " style="text-align: left"><span id="endManufacturerDateSpan"></span></td>
                            <td class="text-muted " style="text-align: right">经销商保修有效期：</td>
                            <td class="text-muted " style="text-align: left"><span id="endSupplierDateSpan"></span></td>
                            <td class="text-muted " style="text-align: right">设备维保状态：</td>
                            <td class="text-muted " style="text-align: left"><span id="insideOutsideStrSpan"></span></td>
                        </tr>
                        <tr>
                            <td class="text-muted " colspan="6">医院填写信息：</td>
                        </tr>
                        <tr>
                            <td class="text-muted " style="text-align: right">医院选择的服务商是：</td>
                            <td class="text-muted " style="text-align: left"><span id="serviceCompanySpan"></span></td>
                            <td class="text-muted " style="text-align: right">服务商联系人：</td>
                            <td class="text-muted " style="text-align: left"><span id="serviceNameSpan"></span></td>
                            <td class="text-muted " style="text-align: right">服务商联系电话：</td>
                            <td class="text-muted " style="text-align: left"><span id="servicePhoneSpan"></span></td>
                        </tr>
                        <tr id="engineerTr">

                        </tr>
                        <tr id="examineTr">

                        </tr>
                    </table>


                    <div id="assignServiceDiv">
                        <h5><b class="text-aqua" style="margin-left:20px">服务商信息</b></h5>
                        <div class="col-md-6">
                            <label  class="col-sm-4 control-label text-muted">服务商类型<span class="text-red">*</span></label>
                            <div class="col-md-8 form-group" >
                                <div class="radio">
                                    <label>
                                        <input type="radio" class="flat-green" name="serviceType" checked value="1102" >厂商
                                    </label>
                                    <label>
                                        <input type="radio" class="flat-green" name="serviceType" value="1105">经销商
                                    </label>
                                    <label>
                                        <input type="radio" class="flat-green" name="serviceType"  value="1103">维修商
                                    </label>
                                </div>
                            </div>
                        </div>

                        <input type="hidden" name="serviceId">
                        <div class="col-md-6" id="assignManufacturerDiv" >
                            <label  class="col-sm-4 control-label text-muted">厂商</label>
                            <div class="col-md-8 form-group" >
                                <input type="text" class="form-control" name="manufacturerName" readonly>
                                <input type="hidden" name="manufacturerId">
                            </div>
                        </div>

                        <div class="col-md-6" id="assignSupplierDiv" style="display: none;">
                            <label  class="col-sm-4 control-label text-muted">经销商</label>
                            <div class="col-md-8 form-group" >
                                <input type="text" class="form-control" name="supplierName" readonly>
                                <input type="hidden" name="supplierId">
                            </div>

                        </div>

                        <div id="assignMaintainerDiv" style="display: none;">
                            <div class="col-md-6" >
                                <label  class="col-sm-4 control-label text-muted">维修商</label>
                                <div class="col-md-8 form-group" >
                                    <input type="text" class="form-control" name="serviceName" data-provide="typeahead"
                                           autocomplete="off" >
                                </div>
                            </div>

                            <div class="col-md-6" >
                                <label  class="col-sm-4 control-label text-muted">维修商联系人</label>
                                <div class="col-md-8 form-group" >
                                    <input type="text" class="form-control" name="serviceContacts">
                                </div>
                            </div>

                            <div class="col-md-6" >
                                <label  class="col-sm-4 control-label text-muted">联系人电话</label>
                                <div class="col-md-8 form-group" >
                                    <input type="text" class="form-control" name="servicePhone">
                                </div>
                            </div>
                        </div>
                    </div>

                    <div id="engineerDiv">
                        <h5><b class="text-aqua" style="margin-left:20px">工程师信息</b></h5>
                       <div class="col-md-12 form-group">
                            <label  class="col-sm-3 control-label text-muted">是否指派负责人</label>
                            <div class="col-md-9" >
                                <div class="radio">
                                    <label>
                                        <input type="radio" class="flat-green" value="1" name="is_dispatch">&nbsp;&nbsp;&nbsp;&nbsp;是
                                    </label>
                                    <label>
                                        <input type="radio" class="flat-green" name="is_dispatch" checked value="0">&nbsp;&nbsp;&nbsp;&nbsp;否
                                    </label>
                                </div>
                            </div>
                        </div>

                        <div id="dispatchDiv" style="display: none;">
                            <%--<div class="col-md-6">
                                <label  class="col-sm-4 control-label text-muted">派工时间<span class="text-red">*</span></label>
                                <div class="col-md-8 form-group" >
                                    <input type="text" class="form-control" name="dispathTime">
                                </div>
                            </div>--%>

                            <div class="col-md-6">
                                <label  class="col-sm-4 control-label text-muted">负责人姓名<span class="text-red">*</span></label>
                                <div class="col-md-8 form-group" >
                                    <input type="text" class="form-control" name="engineerName">
                                </div>
                            </div>

                            <div class="col-md-6">
                                <label  class="col-sm-4 control-label text-muted">负责人电话<span class="text-red">*</span></label>
                                <div class="col-md-8 form-group" >
                                    <input type="text" class="form-control" name="engineerPhone">
                                </div>
                            </div>

                            <div class="col-md-6">
                                <label  class="col-sm-4 control-label text-muted">医院联系人<span class="text-red">*</span></label>
                                <div class="col-md-8 form-group" >
                                    <input type="text" class="form-control" name="hospitalContacts">
                                </div>
                            </div>

                            <div class="col-md-6">
                                <label  class="col-sm-4 control-label text-muted">医院联系人电话<span class="text-red">*</span></label>
                                <div class="col-md-8 form-group" >
                                    <input type="text" class="form-control" name="hospitalPhone">
                                </div>
                            </div>
                        </div>

                    </div>
                </form>
            </div>
            <div class="box-footer">
                 <span class="pull-right">
                    <button data-iziModal-close class="btn btn-default" style="margin-right: 5px">关闭</button>
                </span>
                <span class="pull-right">
                    <button  class="btn btn-info" id="saveAssign" style="margin-right: 5px">提交</button>
                </span>
            </div>
        </div>

        <!-- 1.分配服务上的model -->
        <div id="upkeep-data-modal" style="display: none;">
            <div class="box-body">
                <form id="upkeep-data-form" class="form-horizontal" method="post" enctype="multipart/form-data">
                    <input type="hidden" name="upkeepId" value="">
                    <input type="hidden" name="fileList" value="">
                    <input type="hidden" name="keyType" value="1403">
                    <input type="hidden" name="type" value="upkeep">


                    <div class="col-md-12">
                        <label  class="col-sm-3 control-label text-muted">差旅时间(小时)</label>
                        <div class="col-md-8 form-group" >
                            <input  class="form-control" name="travelTime"/>
                        </div>
                    </div>
                    <div class="col-md-12">
                        <label  class="col-sm-3 control-label text-muted">保养结束时间</label>
                        <div class="col-md-8 form-group" >
                            <input  class="form-control" name="upkeepEndTime"/>
                        </div>
                    </div>

                    <div class="col-md-12">
                        <label  class="col-sm-3 control-label text-muted">保养结束设备状态</label>
                        <div class="col-md-8 form-group" >
                            <select name="endDeviceStatus" style="width: 100%">
                                    <option value="1500">正常</option>
                                    <option value="1501">故障</option>
                                    <option value="1501">宕机</option>
                            </select>
                        </div>
                    </div>
                    <div class="col-md-12">
                        <label  class="col-sm-3 control-label text-muted">保养内容</label>
                        <div class="col-md-8 form-group" >
                            <input  class="form-control" name="upkeepContent"/>
                        </div>
                    </div>

                    <div class="col-md-12">
                        <label  class="col-sm-3 control-label text-muted">文件</label>
                        <div class="col-md-8 form-group" >
                            <input type="file" name="files" class="file" id="files" multiple/>
                        </div>
                    </div>
                </form>
            </div>
            <div class="box-footer">
                 <span class="pull-right">
                    <button data-iziModal-close class="btn btn-default" style="margin-right: 5px">关闭</button>
                </span>
                <span class="pull-right">
                    <button  class="btn btn-info" id="saveUpkeepData" style="margin-right: 5px">提交</button>
                </span>
            </div>
        </div>
        <div id="saveEventDiv"></div>
        <div id="confirmDiv"></div>
        <div id="part-modal" style="display: none;">
            <input type="hidden" value="" name="upkeepId">
            <div class="box-body">
                <div class="row">
                    <div class="col-md-2 pull-left">
                        <div class="form-group">
                            <button name="addPart" type="button" class="btn btn-info btn-sm" title="新增备件" data-toggle="tooltip" data-original-title>
                                <i class="fa fa-plus"></i>
                            </button>
                        </div>
                    </div>
                </div>
            </div>

            <div class="box-body" style="overflow:auto;">
                <table class="table table-striped table-bordered">
                    <thead>
                    <tr class="info">
                        <th class="text-muted text-center">操作</th>
                        <th class="text-muted text-center">类型</th>
                        <th class="text-muted text-center">旧备件名称</th>
                        <th class="text-muted text-center">旧备件品牌</th>
                        <th class="text-muted text-center">旧备件型号</th>
                        <th class="text-muted text-center">旧备件序列号</th>
                        <th class="text-muted text-center">旧备件价格(元)</th>
                        <th class="text-muted text-center">新备件名称</th>
                        <th class="text-muted text-center">新备件品牌</th>
                        <th class="text-muted text-center">新备件型号</th>
                        <th class="text-muted text-center">新备件序列号</th>
                        <th class="text-muted text-center">新备件价格(元)</th>
                        <th class="text-muted text-center">旧备件图片数量</th>
                        <th class="text-muted text-center">新备件图片数量</th>
                        <th class="text-muted text-center">备注</th>
                    </tr>
                    </thead>
                    <tbody id="part_list"></tbody>
                </table>
            </div>
            <div class="box-footer">
                 <span class="pull-right">
                    <button data-iziModal-close class="btn btn-default" style="margin-right: 5px">关闭</button>
                </span>
                <span class="pull-right">
                    <button  class="btn btn-info" id="savePart" style="margin-right: 5px">提交</button>
                </span>
            </div>
        </div>
        <div id="addPart-modal" style="display: none;">
            <div class="box-body">
                <div class="col-md-6">
                        <label  class="col-sm-3 control-label text-muted">类型</label>
                        <div class="col-md-9" >
                            <div class="radio">
                                <label>
                                    <input type="radio" class="flat-green" value="2001" name="partExplain">&nbsp;&nbsp;&nbsp;&nbsp;新增
                                </label>
                                <label>
                                    <input type="radio" class="flat-green" name="partExplain" checked value="2000">&nbsp;&nbsp;&nbsp;&nbsp;更换
                                </label>
                                <label>
                                    <input type="radio" class="flat-green" name="partExplain"  value="2002">&nbsp;&nbsp;&nbsp;&nbsp;收回
                                </label>
                            </div>
                        </div>
                </div>
                <div id="oldDiv">
                    <div class="col-md-6">
                        <label  class="col-sm-3 control-label text-muted">旧备件名称</label>
                        <div class="col-md-9 form-group" >
                            <input type="text" class="form-control" name="oldPartName">
                        </div>
                    </div>

                    <div class="col-md-6">
                        <label  class="col-sm-3 control-label text-muted">旧备件品牌</label>
                        <div class="col-md-9 form-group" >
                            <input type="text" class="form-control" name="oldPartBrand">
                        </div>
                    </div>

                    <div class="col-md-6">
                        <label  class="col-sm-3 control-label text-muted">旧备件型号</label>
                        <div class="col-md-9 form-group" >
                            <input type="text" class="form-control" name="oldPartModel">
                        </div>
                    </div>

                    <div class="col-md-6">
                        <label  class="col-sm-3 control-label text-muted">旧备件序列号</label>
                        <div class="col-md-9 form-group" >
                            <input type="text" class="form-control" name="oldPartSn">
                        </div>
                    </div>

                    <div class="col-md-6">
                        <label  class="col-sm-3 control-label text-muted">旧备件价格(元)</label>
                        <div class="col-md-9 form-group" >
                            <input type="text" class="form-control" name="oldPartPrice">
                        </div>
                    </div>

                    <form id="oldFileForm" method="POST" class="form-horizontal" enctype="multipart/form-data">
                        <input type="hidden" value="1407" name="keyType">
                        <input type="hidden" value="3404" name="fileType">
                        <div class="col-md-10">
                            <label  class="col-sm-2 control-label text-muted">旧备件图片</label>
                            <div class="col-md-9 form-group" >
                                <input type="file" class="file"   name="files" multiple>
                            </div>
                        </div>
                    </form>
                </div>
                <div id="newDiv">
                    <div class="col-md-6">
                        <label  class="col-sm-3 control-label text-muted">新备件名称</label>
                        <div class="col-md-9 form-group" >
                            <input type="text" class="form-control" name="newPartName">
                        </div>
                    </div>

                    <div class="col-md-6">
                        <label  class="col-sm-3 control-label text-muted">新备件品牌</label>
                        <div class="col-md-9 form-group" >
                            <input type="text" class="form-control" name="newPartBrand">
                        </div>
                    </div>

                    <div class="col-md-6">
                        <label  class="col-sm-3 control-label text-muted">新备件型号</label>
                        <div class="col-md-9 form-group" >
                            <input type="text" class="form-control" name="newPartModel">
                        </div>
                    </div>

                    <div class="col-md-6">
                        <label  class="col-sm-3 control-label text-muted">新备件序列号</label>
                        <div class="col-md-9 form-group" >
                            <input type="text" class="form-control" name="newPartSn">
                        </div>
                    </div>

                    <div class="col-md-6">
                        <label  class="col-sm-3 control-label text-muted">新备件价格(元)</label>
                        <div class="col-md-9 form-group" >
                            <input type="text" class="form-control" name="newPartPrice">
                        </div>
                    </div>

                    <form id="newFileForm" method="POST" class="form-horizontal" enctype="multipart/form-data">
                        <input type="hidden" value="1407" name="keyType">
                        <input type="hidden" value="3403" name="fileType">
                        <div class="col-md-10">
                            <label  class="col-sm-2 control-label text-muted">新备件图片</label>
                            <div class="col-md-9 form-group" >
                                <input type="file" class="file"   name="files" multiple>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="col-md-6">
                    <label  class="col-sm-3 control-label text-muted">备注</label>
                    <div class="col-md-9 form-group" >
                        <input type="text" class="form-control" name="remark">
                    </div>
                </div>
            </div>
            <div class="box-footer">
                 <span class="pull-right">
                    <button data-iziModal-close class="btn btn-default" style="margin-right: 5px">关闭</button>
                </span>
                <span class="pull-right">
                    <button  class="btn btn-info" id="addPart" style="margin-right: 5px">提交</button>
                </span>
            </div>
        </div>
        <div id="showFileDiv" style="display: none;">
            <div class="box-body">
                <div class="col-md-12" id="oldFileDiv">
                    <label  class="col-sm-1 control-label text-muted">旧备件图片</label><div class="col-md-9" id="oldFileImgDiv"></div>
                </div>

                <div class="col-md-12"  id="newFileDiv">
                    <label  class="col-sm-1 control-label text-muted">新备件图片</label><div class="col-md-9" id="newFileImgDiv"></div>
                </div>
            </div>

            <div class="box-footer">
                 <span class="pull-right">
                    <button data-iziModal-close class="btn btn-default" style="margin-right: 5px">关闭</button>
                </span>
            </div>
        </div>
        <div id="addUpkeep-modal" style="display: none;">
            <div class="box-body">
                <form id="addUpkeepForm" class="form-horizontal" method="post">
                    <div><b class="text-aqua" style="margin-left:20px">保养信息</b></div>
                    <div class="col-md-12">
                        <label  class="col-sm-4 control-label text-muted">保养申请人 <span class="text-red">*</span></label>
                        <div class="col-md-8 form-group" >
                            <input type="text" class="form-control" name="upkeepApplicant">
                        </div>
                    </div>

                    <div class="col-md-12">
                        <label  class="col-sm-4 control-label text-muted">申请人电话 <span class="text-red">*</span></label>
                        <div class="col-md-8 form-group" >
                            <input type="text" class="form-control" name="upkeepApplicantPhone">
                        </div>
                    </div>

                    <div class="col-md-12">
                        <label  class="col-sm-4 control-label text-muted">设备 <span class="text-red">*</span></label>
                        <div class="col-md-7 form-group input-group date" >
                            <input type="text" class="form-control" name="deviceName" readonly>
                            <div id="device" class="input-group-addon" data-toggle="tooltip"style="background-color: #fff;cursor: pointer">
                                <i class="fa fa-bars"></i>
                            </div>
                            <input type="hidden" value="" name="deviceId">
                            <div id="emptyDeviceName"  class="input-group-addon" title="清空" data-toggle="tooltip"style="background-color: #fff;cursor: pointer">
                                <i class="fa fa-close"></i>
                            </div>
                        </div>
                    </div>

                    <c:if test="${loginUser.type == 1104}">
                        <div class="col-md-12">
                            <label  class="col-sm-4 control-label text-muted">医院 <span class="text-red">*</span></label>
                            <div class="col-md-8 form-group" >
                                <input type="text" class="form-control" name="hospitalName" readonly>
                               <%-- <div id="hospital" class="input-group-addon" title="请选择" data-toggle="tooltip"style="background-color: #fff;cursor: pointer">
                                    <i class="fa fa-bars"></i>
                                </div>--%>
                                <input type="hidden" name="hospitalId">
                                <%--<div  id="emptyHospitalName" class="input-group-addon" title="清空" data-toggle="tooltip"style="background-color: #fff;cursor: pointer">
                                    <i class="fa fa-close"></i>
                                </div>--%>
                            </div>
                        </div>
                    </c:if>


                    <div class="col-md-12 form-group">
                        <label  class="col-sm-4 control-label text-muted">上次保养时间</label>
                        <div class="col-md-8 form-group" >
                                <span name="lastUpkeepDateSpan" style="height: 49px; width: 100%">&nbsp;</span>
                        </div>
                    </div>

                    <%--<div class="col-md-12">
                        <label  class="col-sm-4 control-label text-muted">保养日期 <span class="text-red">*</span></label>
                        <div class="col-md-8 form-group" >
                            <input type="text" class="form-control" name="upkeepDate">
                        </div>
                    </div>--%>

                    <div class="col-md-12">
                        <label  class="col-sm-4 control-label text-muted">设备状态 <span class="text-red">*</span></label>
                        <div class="col-md-8 form-group" >
                            <select name="deviceStatus" style="width: 100%">
                                    <option value="1500">正常</option>
                                    <option value="1501">故障</option>
                                    <option value="1502">宕机</option>
                            </select>
                        </div>
                    </div>
                    <h5><b class="text-aqua" style="margin-left:20px">服务商信息</b></h5>
                    <div class="col-md-12">
                        <label  class="col-sm-4 control-label text-muted">类型<span class="text-red">*</span></label>
                        <div class="col-md-8 form-group" >
                            <div class="radio">
                                <label>
                                    <input type="radio" class="flat-green" name="serviceType" value="1102" >厂商
                                </label>
                                <label>
                                    <input type="radio" class="flat-green" name="serviceType" value="1105">经销商
                                </label>
                                <label>
                                    <input type="radio" class="flat-green" name="serviceType"  value="1103">维修商
                                </label>
                                <c:if test="${loginUser.type == '1101'}">
                                    <label>
                                        <input type="radio" class="flat-green" name="serviceType"  checked value="0">无
                                    </label>
                                </c:if>
                            </div>
                        </div>
                    </div>

                    <input type="hidden" name="serviceId">
                    <div class="col-md-12" id="manufacturerDiv" style="display: none;">
                        <label  class="col-sm-4 control-label text-muted">厂商</label>
                        <div class="col-md-8 form-group" >
                            <input type="text" class="form-control" name="manufacturerName" readonly>
                            <input type="hidden" name="manufacturerId">
                        </div>
                    </div>

                    <div class="col-md-12" id="supplierDiv" style="display: none;">
                        <label  class="col-sm-4 control-label text-muted">经销商</label>
                        <div class="col-md-8 form-group" >
                            <input type="text" class="form-control" name="supplierName" readonly>
                            <input type="hidden" name="supplierId">
                        </div>
                    </div>

                    <div id="maintainerDiv" style="display: none;">
                        <div class="col-md-12" >
                            <label  class="col-sm-4 control-label text-muted">维修商</label>
                            <div class="col-md-8 form-group" >
                                <input type="text" class="form-control" name="serviceName" data-provide="typeahead"
                                       autocomplete="off" >
                            </div>
                        </div>

                        <div class="col-md-12" >
                            <label  class="col-sm-4 control-label text-muted">维修商联系人</label>
                            <div class="col-md-8 form-group" >
                                <input type="text" class="form-control" name="serviceContacts">
                            </div>
                        </div>

                        <div class="col-md-12" >
                            <label  class="col-sm-4 control-label text-muted">联系人电话</label>
                            <div class="col-md-8 form-group" >
                                <input type="text" class="form-control" name="servicePhone">
                            </div>
                        </div>
                    </div>
                    <div id="addUpkeepEngineerDiv" style="display: none;">
                        <div><b class="text-aqua" style="margin-left:20px">工程师信息</b></div>
                        <div class="col-md-12">
                            <label  class="col-sm-4 control-label text-muted">是否填写工程师</label>
                            <div class="col-md-8 form-group" >
                                <div class="radio">
                                    <label>
                                        <input type="radio" class="flat-green" name="hospital_user" value="1" >&nbsp;&nbsp;&nbsp;&nbsp;是
                                    </label>
                                    <label>
                                        <input type="radio" class="flat-green" name="hospital_user" value="0" checked>&nbsp;&nbsp;&nbsp;&nbsp;否
                                    </label>
                                </div>
                            </div>
                        </div>

                        <div id="userDiv" style="display: none;">
                            <div class="col-md-12" >
                                <label  class="col-sm-4 control-label text-muted">工程师姓名<span class="text-red">*</span></label>
                                <div class="col-md-8 form-group" >
                                    <input type="text" class="form-control" name="engineerName">
                                </div>
                            </div>

                            <div class="col-md-12" >
                                <label  class="col-sm-4 control-label text-muted">工程师电话<span class="text-red">*</span></label>
                                <div class="col-md-8 form-group" >
                                    <input type="text" class="form-control" name="mobile">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-12">
                        <label  class="col-sm-4 control-label text-muted">备注</label>
                        <div class="col-md-8 form-group" >
                            <input type="text" class="form-control" name="remark">
                        </div>
                    </div>
                </form>

            <div class="box-footer">
                 <span class="pull-right">
                    <button data-iziModal-close class="btn btn-default" style="margin-right: 5px">关闭</button>
                </span>
                <span class="pull-right">
                    <button  class="btn btn-info" id="saveUpkeep" style="margin-right: 5px">提交</button>
                </span>
            </div>
        </div>
        </div>
        <!-- 审核维修商-->
         <div id="examine-maintainer" style="display: none;">
            <div class="box-body">
                <form id="examine-maintainer-form" class="form-horizontal" method="post">
                    <input type="hidden" name="upkeepId">
                    <div class="col-md-12">
                        <label  class="col-sm-4 control-label text-muted">服务商名称</label>
                        <div class="col-md-8 form-group" >
                            <input type="text" class="form-control" name="maintainerName" readonly>
                        </div>
                    </div>

                    <div class="col-md-12">
                        <label  class="col-sm-4 control-label text-muted">服务商联系人</label>
                        <div class="col-md-8 form-group" >
                            <input type="text" class="form-control" name="maintainerContacts">
                        </div>
                    </div>

                    <div class="col-md-12">
                        <label  class="col-sm-4 control-label text-muted">服务商联系电话</label>
                        <div class="col-md-8 form-group" >
                            <input type="text" class="form-control" name="maintainerPhone">
                        </div>
                    </div>

                    <div class="col-md-12">
                        <label  class="col-sm-4 control-label text-muted">审核</label>
                        <div class="col-md-8 form-group" >
                            <div class="radio">
                                <label>
                                    <input type="radio" class="flat-green" name="examine" value="1" checked>&nbsp;&nbsp;&nbsp;&nbsp;通过
                                </label>
                                <label>
                                    <input type="radio" class="flat-green" name="examine" value="0" >&nbsp;&nbsp;&nbsp;不通过
                                </label>
                            </div>
                        </div>
                    </div>

                    <div class="col-md-12">
                        <label  class="col-sm-4 control-label text-muted">审核说明</label>
                        <div class="col-md-8 form-group" >
                            <input type="text" class="form-control" name="examineComment">
                        </div>
                    </div>
                </form>

                <div class="box-footer">
             <span class="pull-right">
                <button data-iziModal-close class="btn btn-default" style="margin-right: 5px">关闭</button>
            </span>
                    <span class="pull-right">
                <button  class="btn btn-info" id="saveExamineMaintainer" style="margin-right: 5px">提交</button>
            </span>
                </div>
            </div>
         </div>
        <div id="updateEngineer" style="display: none;">
            <div class="box-body">
                <form id="updateEngineer-form" class="form-horizontal" method="post">
                    <input type="hidden" name="appointId">
                    <div class="col-md-12">
                        <label  class="col-sm-4 control-label text-muted">负责人姓名<span class="text-red">*</span></label>
                        <div class="col-md-8 form-group" >
                            <input type="text" class="form-control" name="engineerName">
                        </div>
                    </div>

                    <div class="col-md-12">
                        <label  class="col-sm-4 control-label text-muted">负责人电话<span class="text-red">*</span></label>
                        <div class="col-md-8 form-group" >
                            <input type="text" class="form-control" name="engineerPhone">
                        </div>
                    </div>
                </form>

                <div class="box-footer">
                 <span class="pull-right">
                    <button data-iziModal-close class="btn btn-default" style="margin-right: 5px">关闭</button>
                </span>
                    <span class="pull-right">
                    <button  class="btn btn-info" id="saveEngineerInfo" style="margin-right: 5px">提交</button>
                </span>
                </div>
            </div>
        </div>
        <div id="deviceDvie"></div>
        <div id="hospitalDvie"></div>


        <footer class="main-footer">
            <div class="pull-right hidden-xs">
                <b>Version</b> 1.0.0
            </div>
            <strong>Copyright &copy; 2019 <a href="http://almsaeedstudio.com">Topmed</a>.</strong> All rights reserved.
        </footer>
        <jsp:include page="../menuRight.jsp"></jsp:include>
    </div>
    <!-- ./wrapper -->

    <!-- ./wrapper -->
    <script src="<%=basePath%>/plugins/jQuery/jquery-2.2.3.min.js"></script>
    <script src="<%=basePath%>/bootstrap/js/bootstrap.min.js"></script>
    <script src="<%=basePath%>/plugins/slimScroll/jquery.slimscroll.min.js"></script>
    <script src="<%=basePath%>/plugins/fastclick/fastclick.js"></script>
    <script src="<%=basePath%>/dist/js/app.min.js"></script>
    <script src="<%=basePath%>/dist/js/demo.js"></script>
    <script src="<%=basePath%>/bootstrapvalidator/js/bootstrapValidator.min.js"></script>
    <script src="<%=basePath%>/toastr/toastr.js"></script>
    <script src="<%=basePath%>/pagination/js/jquery.pagination.min.js"></script>
    <script src="<%=basePath%>/js/overallSituation.js"></script>
    <script src="<%=basePath%>/fileupload/fileinput.min.js"></script>
    <script src="<%=basePath%>/fileupload/zh.js" type="text/javascript"></script>
    <script src="<%=basePath%>/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
    <script src="<%=basePath%>/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
    <script src="<%=basePath%>/plugins/select2/select2.min.js"></script>
    <script src="<%=basePath%>/plugins/select2/i18n/zh-CN.js"></script>
    <script src="<%=basePath%>/plugins/iCheck/icheck.min.js"></script>
    <script src="<%=basePath%>/plugins/iziModal/js/iziModal.min.js"></script>
    <script src="<%=basePath%>/plugins/flavr/flavr.min.js"></script>
    <script src="<%=basePath%>/plugins/bootstrap-treeview/js/bootstrap-treeview.js"></script>
    <script src="<%=basePath%>/plugins/viewer/viewer.min.js"></script>
    <script src="<%=basePath%>/js/typeahead.js"></script>
 <%--   <script src="<%=basePath%>/plugins/autocompleter/jquery.autocompleter.js"></script>--%>
    <script src="<%=basePath%>/js/map.js"></script>
    <script src="<%=basePath%>/js/query-device.js"></script>
    <script src="<%=basePath%>/js/query-hospital.js"></script>
    <script src="<%=basePath%>/js/event-add.js"></script>
    <script src="<%=basePath%>/js/public-confirm.js"></script>
    <script src="<%=basePath%>/js/upkeep/upkeep-page.js"></script>
    </body>
</html>
